package cn.kgc.cjk_yy.controller;


import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class UserController {

//    //用户登录操作
//    @Resource
//    private UserService devUserService;

    //默认初始页面
    @RequestMapping("/")
    public String index(){
        return "start";
    }


    //登录页面选择
    @RequestMapping("/LandingPage/{num}")
    public String LandingPage(@PathVariable("num") Integer num, HttpServletRequest request){

        if(num==1){
            request.getSession().removeAttribute("devUser");
            return "dev_user_login";
        }else if(num==2){
            request.getSession().removeAttribute("backendUser");
            return "backend_user_login";
        }
        return "start";
    }


//
//    //后台管理员登录
//    @RequestMapping(value="backend_user_login",method = RequestMethod.POST)
//    public String backend_user_login(@RequestParam("usercode") String usercode, @RequestParam("password") String password, HttpServletRequest request) throws Exception {
//        System.out.println(usercode);
//        System.out.println(password);
//
//        BackendUser user= devUserService.backend_user_login(usercode, password);
//        if(null==user){
//            return "backend_user_login";
//        }else{
//            request.getSession().setAttribute("backendUser",user);
//            return "backend_user/backendShow";
//        }
//    }

}
